<?php
class TDataTableTransferenciaVagas extends TDataTable
{
    public function __construct($usuario = NULL, $pfcid = NULL, $options = array())
    {       
	    $model  = new ViewVagasTransferencia();	
        $criterio = array();	    
        switch($pfcid){
	        case PerfilComportamental::NucleoGestor :
	            $criterio['precondicao'] = 'nucleogestorid='. $usuario->nucleogestorid;
                break;
	        
            default:
                $criterio['precondicao'] = 'orgaoid='. $usuario->orgaoid;
                break;	        
	    }	    
		parent::__construct($model,'vagaid',$criterio,$options);
        $this->addColumnsData(array(
        						'vagaid',
        						'contratoid',
        						array('name'=>'numeroorgao', 'header'=>'Nr. Contrato'),
        						'orgao', 
        						'cargo', 
        						'lotacao', 
        						array('name'=>'nucleogestor', 'header'=>'Nucleo Gestor'), 
        						'salario'));

		$this->addFiltersCombo(array('contratoid', 'orgao', 'cargo', 'lotacao', 'nucleogestor'));
    }
}